package com.bjut.vendormgrsys.web.rest;

import com.bjut.vendormgrsys.web.dto.ResultInfo;
import com.bjut.vendormgrsys.web.dto.ResultList;
import com.bjut.vendormgrsys.web.dto.ResultStatusList;
import com.bjut.vendormgrsys.web.dto.Success;
import com.bjut.vendormgrsys.web.dto.campaign.*;
import com.bjut.vendormgrsys.web.dto.user.Body;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.util.List;

@Validated
public interface CampaignApi {

    @Operation(summary = "创建活动和修改", description = "创建活动和修改", tags={ "Campaign" })
    @ApiResponses(value = {
            @ApiResponse(responseCode = "200", description = "成功", content = @Content(schema = @Schema(implementation = Success.class))) })
    @RequestMapping(value = "/campaign/create",
            produces = { "application/json;charset=UTF-8" },
            consumes = { "application/json;charset=UTF-8" },
            method = RequestMethod.POST)
    ResponseEntity<Success> campaignCreatePost(@Parameter(in = ParameterIn.DEFAULT, description = "", required=true, schema=@Schema()) @Valid @RequestBody CampaignInfo body);


    @Operation(summary = "获取活动列表", description = "", tags={ "Campaign" })
    @ApiResponses(value = {
            @ApiResponse(responseCode = "200", description = "获取活动列表", content = @Content(schema = @Schema(implementation = ResultList.class))) })
    @RequestMapping(value = "/campaign/findAll",
            produces = { "application/json;charset=UTF-8" },
            consumes = { "application/json;charset=UTF-8" },
            method = RequestMethod.POST)
    ResponseEntity<ResultList> campaignFindAllPost(@Parameter(in = ParameterIn.DEFAULT, description = "", schema=@Schema()) @Valid @RequestBody CampaignSearch body);

    @Operation(summary = "状态变更", description = "修改活动状态", tags={ "Campaign" })
    @ApiResponses(value = {
            @ApiResponse(responseCode = "200", description = "成功", content = @Content(schema = @Schema(implementation = Success.class))) })
    @RequestMapping(value = "/campaign/changeStatus",
            produces = { "application/json;charset=UTF-8" },
            consumes = { "application/json;charset=UTF-8" },
            method = RequestMethod.POST)
    ResponseEntity<Success> changeStatusPost(@Parameter(in = ParameterIn.DEFAULT, description = "", schema=@Schema()) @Valid @RequestBody List<Body> body);

    @Operation(summary = "审核状态变更", description = "审核状态变更", tags={ "Campaign" })
    @ApiResponses(value = {
            @ApiResponse(responseCode = "200", description = "成功", content = @Content(schema = @Schema(implementation = Success.class))) })
    @RequestMapping(value = "/campaign/changeAuditStatus",
            produces = { "application/json;charset=UTF-8" },
            consumes = { "application/json;charset=UTF-8" },
            method = RequestMethod.POST)
    ResponseEntity<Success> changeAuditStatusPost(@Parameter(in = ParameterIn.DEFAULT, description = "", schema=@Schema()) @Valid @RequestBody List<Body> body);

    @Operation(summary = "根据id获取活动信息", description = "根据id获取活动信息", tags={ "Campaign" })
    @ApiResponses(value = {
            @ApiResponse(responseCode = "200", description = "成功", content = @Content(schema = @Schema(implementation = Success.class))) })
    @RequestMapping(value = "/campaign/campaignInfoById",
            produces = { "application/json;charset=UTF-8" },
            method = RequestMethod.GET)
    ResponseEntity<ResultInfo> campaignInfoByIdPost(@RequestParam String id);

    @Operation(summary = "状态统计", description = "状态统计", tags={ "Campaign" })
    @ApiResponses(value = {
            @ApiResponse(responseCode = "200", description = "成功", content = @Content(schema = @Schema(implementation = Success.class))) })
    @RequestMapping(value = "/campaign/statusList",
            produces = { "application/json;charset=UTF-8" },
            consumes = { "application/json;charset=UTF-8" },
            method = RequestMethod.POST)
    ResponseEntity<ResultStatusList> statusListPost(@Parameter(in = ParameterIn.DEFAULT, description = "", schema=@Schema()) @Valid @RequestBody CampaignSearch body);


    @Operation(summary = "报名活动", description = "报名活动", tags={ "Campaign" })
    @ApiResponses(value = {
            @ApiResponse(responseCode = "200", description = "成功", content = @Content(schema = @Schema(implementation = Success.class))) })
    @RequestMapping(value = "/campaign/signUp",
            produces = { "application/json;charset=UTF-8" },
            consumes = { "application/json;charset=UTF-8" },
            method = RequestMethod.POST)
    ResponseEntity<Success> signUpCampaignPost(@Parameter(in = ParameterIn.DEFAULT, description = "", required=true, schema=@Schema()) @Valid @RequestBody List<CampaignUserInfo> body);

    @Operation(summary = "取消报名活动", description = "取消报名活动", tags={ "Campaign" })
    @ApiResponses(value = {
            @ApiResponse(responseCode = "200", description = "成功", content = @Content(schema = @Schema(implementation = Success.class))) })
    @RequestMapping(value = "/campaign/cancelSignUp",
            produces = { "application/json;charset=UTF-8" },
            consumes = { "application/json;charset=UTF-8" },
            method = RequestMethod.POST)
    ResponseEntity<Success> cancelSignUpCampaignPost(@Parameter(in = ParameterIn.DEFAULT, description = "", required=true, schema=@Schema()) @Valid @RequestBody List<CampaignUserInfo> body);

    @Operation(summary = "为活动添加拓展补充", description = "为活动添加拓展补充", tags={ "Campaign" })
    @ApiResponses(value = {
            @ApiResponse(responseCode = "200", description = "成功", content = @Content(schema = @Schema(implementation = Success.class))) })
    @RequestMapping(value = "/campaign/addExpansion",
            produces = { "application/json;charset=UTF-8" },
            consumes = { "application/json;charset=UTF-8" },
            method = RequestMethod.POST)
    ResponseEntity<Success> addExpansionPost(@Parameter(in = ParameterIn.DEFAULT, description = "", schema=@Schema()) @Valid @RequestBody CampaignUserInfo body);

    @Operation(summary = "为活动添加拓展补充文件", description = "为活动添加拓展补充文件", tags={ "Campaign" })
    @ApiResponses(value = {
            @ApiResponse(responseCode = "200", description = "成功", content = @Content(schema = @Schema(implementation = Success.class))) })
    @RequestMapping(value = "/campaign/addExpansionFile",
            method = RequestMethod.POST)
    ResponseEntity<Success> addExpansionFilePost(CampaignFile body);

}
